package com.xqm.springcloud.comsumer.config;

import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

/**
 * @author ShiMing
 * @version 1.0
 * @name RestTemplate
 * @description TODO
 * @date 2020/8/20
 */

@Configuration
public class RestTemplateCofig {

    //@Bean
    //public RestTemplate restTemplate(){
    //    return new RestTemplate();
    //}
    //

    // 负载均衡实现Rest Template
    @Bean
    @LoadBalanced
    public RestTemplate restTemplate() {
        return new RestTemplate();
    }

}
